<?php
namespace Products\Model;

class Products
{
	public $product_id;
	public $category_id;
	public $user_id;
	public $product_name;
	public $type;
	public $country;
	public $quantity;
	public $price;
	public $p_status;
	public $added_date;
	public $modified_date;
	public $product_image;
	public $product_content;
	public $offer_content;
	public $offer_for_quantity;
	public $offer_price;
	public $offer_status;
	public $expire_date_from;
	public $expire_date_to;
	public $username;
	public $type_of_user;
	public $oquantity;
	public $oprice;
	
	public function exchangeArray($data){
	
		$this->product_id        = (isset($data['product_id']))     ? $data['product_id']	  : null;
		$this->category_id       = (isset($data['category_id']))    ? $data['category_id']	  : null;		
		$this->user_id           = (isset($data['user_id']))        ? $data['user_id']	      : null;		
		$this->product_name      = (isset($data['product_name']))   ? $data['product_name']   : null;
		$this->type              = (isset($data['type']))           ? $data['type']           : null;
		$this->country           = (isset($data['country']))        ? $data['country']        : null;
		$this->quantity          = (isset($data['quantity']))       ? $data['quantity']       : null;
		$this->price             = (isset($data['price']))          ? $data['price']          : null;
		$this->p_status          = (isset($data['p_status']))       ? $data['p_status']       : null;
		$this->added_date        = (isset($data['added_date']))     ? $data['added_date']     : null;
		$this->modified_date     = (isset($data['modified_date']))  ? $data['modified_date']  : null;
		$this->product_image     = (isset($data['product_image']))  ? $data['product_image']  : null;
		$this->product_content   = (isset($data['product_content']))? $data['product_content']: null;
		$this->offer_content     = (isset($data['offer_content']))? $data['offer_content']: null;
		$this->offer_for_quantity   = (isset($data['offer_for_quantity']))? $data['offer_for_quantity']: null;
		$this->offer_price       = (isset($data['offer_price']))    ? $data['offer_price']: null;
		$this->offer_status      = (isset($data['offer_status']))   ? $data['offer_status']: null;
		$this->expire_date_from  = (isset($data['expire_date_from']))? $data['expire_date_from']: null;
		$this->expire_date_to    = (isset($data['expire_date_to'])) ? $data['expire_date_to']: null;
		$this->product_content   = (isset($data['product_content']))? $data['product_content']: null;
		$this->username          = (isset($data['username']))       ? $data['username']       : null;
		$this->type_of_user      = (isset($data['type_of_user']))   ? $data['type_of_user']   : null;
		$this->oquantity      = (isset($data['oquantity']))   ? $data['oquantity']   : null;
		$this->type_of_user      = (isset($data['type_of_user']))   ? $data['type_of_user']   : null;
		$this->oprice      = (isset($data['oprice']))   ? $data['oprice']   : null;
	}

	// Add the following method:
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}

}